(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 12.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     21966,        590]
NotebookOptionsPosition[     20530,        560]
NotebookOutlinePosition[     20867,        575]
CellTagsIndexPosition[     20824,        572]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Kinematics", "Subsection",
 CellChangeTimes->{{3.823582071786221*^9, 
  3.823582076986455*^9}},ExpressionUUID->"2638955b-d1e8-4e28-ba05-\
db1765a28fd7"],

Cell[BoxData[
 RowBox[{
  RowBox[{"T", "[", 
   RowBox[{"\[Alpha]_", ",", "a_", ",", "\[Theta]_", ",", "d_"}], "]"}], ":=", 
  RowBox[{"{", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", 
      RowBox[{"-", 
       RowBox[{"Sin", "[", "\[Theta]", "]"}]}], ",", "0", ",", "a"}], "}"}], 
    ",", "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{"Sin", "[", "\[Theta]", "]"}], 
       RowBox[{"Cos", "[", "\[Alpha]", "]"}]}], ",", 
      RowBox[{
       RowBox[{"Cos", "[", "\[Theta]", "]"}], 
       RowBox[{"Cos", "[", "\[Alpha]", "]"}]}], ",", 
      RowBox[{"-", 
       RowBox[{"Sin", "[", "\[Alpha]", "]"}]}], ",", 
      RowBox[{
       RowBox[{"-", "d"}], " ", 
       RowBox[{"Sin", "[", "\[Alpha]", "]"}]}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{"Sin", "[", "\[Theta]", "]"}], " ", 
       RowBox[{"Sin", "[", "\[Alpha]", "]"}]}], ",", 
      RowBox[{
       RowBox[{"Cos", "[", "\[Theta]", "]"}], 
       RowBox[{"Sin", "[", "\[Alpha]", "]"}]}], ",", 
      RowBox[{"Cos", "[", "\[Alpha]", "]"}], ",", 
      RowBox[{"d", " ", 
       RowBox[{"Cos", "[", "\[Alpha]", "]"}]}]}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}]}], 
   "\[IndentingNewLine]", "}"}]}]], "Input",
 CellChangeTimes->{{3.823582093563463*^9, 3.823582186507723*^9}},
 CellLabel->"In[1]:=",ExpressionUUID->"1293ae6c-31e5-4370-8907-caad95c252d0"],

Cell[BoxData[
 RowBox[{
  RowBox[{"p", "[", 
   RowBox[{
   "\[Theta]1_", ",", "\[Theta]2_", ",", "\[Theta]3_", ",", "\[Theta]4_", ",",
     "\[Theta]5_", ",", "\[Theta]6_", ",", "\[Theta]7_"}], "]"}], ":=", 
  RowBox[{
   RowBox[{"T", "[", 
    RowBox[{"0", ",", "0", ",", "\[Theta]1", ",", "0.333"}], "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     RowBox[{"-", 
      FractionBox["\[Pi]", "2"]}], ",", "0", ",", "\[Theta]2", ",", "0"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0", ",", "\[Theta]3", ",", "0.316"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0.0825", ",", "\[Theta]4", ",", "0"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     RowBox[{"-", 
      FractionBox["\[Pi]", "2"]}], ",", 
     RowBox[{"-", "0.0825"}], ",", "\[Theta]5", ",", "0.384"}], "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0", ",", "\[Theta]6", ",", "0"}], "]"}],
    ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0.088", ",", "\[Theta]7", ",", "0"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{"\[Pi]", ",", "0", ",", 
     RowBox[{"-", 
      FractionBox["\[Pi]", "4"]}], ",", 
     RowBox[{"-", "0.107"}]}], "]"}]}]}]], "Input",
 CellChangeTimes->{{3.823582198644116*^9, 3.823582337516674*^9}, {
  3.823582386285802*^9, 3.823582419461158*^9}, {3.823582453054434*^9, 
  3.82358249544624*^9}},
 CellLabel->"In[2]:=",ExpressionUUID->"d8b24c1a-4cdd-43ed-9ee4-98459c265c06"],

Cell[BoxData[
 RowBox[{
  RowBox[{"pM", "=", 
   RowBox[{"Simplify", "[", 
    RowBox[{
     RowBox[{"p", "[", 
      RowBox[{
      "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", ",", 
       "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "/.", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"0.", "\[Rule]", "0"}], ",", 
       RowBox[{"1.", "\[Rule]", "1"}]}], "}"}]}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.823582623495618*^9, 3.823582655774441*^9}, {
  3.823582693975222*^9, 3.823582697862906*^9}},
 CellLabel->"In[3]:=",ExpressionUUID->"5eced034-3e4c-4a28-956f-542ef9fac943"],

Cell[BoxData[
 RowBox[{
  RowBox[{"euler", "[", 
   RowBox[{
   "\[Theta]1_", ",", "\[Theta]2_", ",", "\[Theta]3_", ",", "\[Theta]4_", ",",
     "\[Theta]5_", ",", "\[Theta]6_", ",", "\[Theta]7_"}], "]"}], ":=", 
  RowBox[{"{", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"p", "[", 
      RowBox[{
      "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", ",", 
       "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "4"}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"p", "[", 
      RowBox[{
      "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", ",", 
       "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"2", ",", "4"}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"p", "[", 
      RowBox[{
      "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", ",", 
       "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"3", ",", "4"}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
    RowBox[{"ArcTan", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"p", "[", 
        RowBox[{
        "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", 
         ",", "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"2", ",", "1"}], "]"}], "]"}], "/", 
      RowBox[{
       RowBox[{"p", "[", 
        RowBox[{
        "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", 
         ",", "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"-", 
     RowBox[{"ArcSin", "[", 
      RowBox[{
       RowBox[{"p", "[", 
        RowBox[{
        "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", 
         ",", "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"3", ",", "1"}], "]"}], "]"}], "]"}]}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"ArcTan", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"p", "[", 
        RowBox[{
        "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", 
         ",", "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"3", ",", "2"}], "]"}], "]"}], "/", 
      RowBox[{
       RowBox[{"p", "[", 
        RowBox[{
        "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", 
         ",", "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "[", 
       RowBox[{"[", 
        RowBox[{"3", ",", "3"}], "]"}], "]"}]}], "]"}]}], 
   "\[IndentingNewLine]", "}"}]}]], "Input",
 CellChangeTimes->{{3.823594209828718*^9, 3.823594305244712*^9}},
 CellLabel->"In[4]:=",ExpressionUUID->"25bca131-2606-4f40-956f-9b4b520b9c99"],

Cell[BoxData[
 RowBox[{
  RowBox[{"eM", "=", 
   RowBox[{"Simplify", "[", 
    RowBox[{
     RowBox[{"euler", "[", 
      RowBox[{
      "\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3", ",", "\[Theta]4", ",", 
       "\[Theta]5", ",", "\[Theta]6", ",", "\[Theta]7"}], "]"}], "/.", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"0.", "\[Rule]", "0"}], ",", 
       RowBox[{"1.", "\[Rule]", "1"}]}], "}"}]}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.823594332044726*^9, 3.823594334756621*^9}},
 CellLabel->"In[6]:=",ExpressionUUID->"31153068-cde7-4919-97b6-1af27bb17782"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"{", 
   RowBox[{
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]1"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]2"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]3"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]4"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]5"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]6"}], "]"}], ",", 
    RowBox[{"D", "[", 
     RowBox[{"eM", ",", "\[Theta]7"}], "]"}]}], "}"}], ";"}]], "Input",
 CellChangeTimes->{{3.8235956031590548`*^9, 3.8235957116785507`*^9}, {
   3.823602846632757*^9, 3.8236028864799213`*^9}, 
   3.823751768880197*^9},ExpressionUUID->"9db25a01-77cb-4265-b9c7-\
eac93a89fd5b"],

Cell[BoxData[
 InterpretationBox[
  TagBox[
   FrameBox[GridBox[{
      {
       ItemBox[
        TagBox[
         RowBox[{"{", 
          TemplateBox[{"1"},
           "OutputSizeLimit`Skeleton"], "}"}],
         Short[#, 5]& ],
        BaseStyle->{Deployed -> False},
        StripOnInput->False]},
      {GridBox[{
         {
          PaneBox[
           TagBox[
            TooltipBox[
             StyleBox[
              StyleBox[
               DynamicBox[ToBoxes[
                 FEPrivate`FrontEndResource[
                 "FEStrings", "sizeBriefExplanation"], StandardForm],
                ImageSizeCache->{61., {2., 8.}}],
               StripOnInput->False,
               DynamicUpdating->True,
               LineSpacing->{1, 2},
               LineIndent->0,
               LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLText",
              StripOnInput->False],
             StyleBox[
              DynamicBox[
               ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"], 
                StandardForm]], DynamicUpdating -> True, LineIndent -> 0, 
              LinebreakAdjustments -> {1., 100, 0, 0, 0}, 
              LineSpacing -> {1, 2}, StripOnInput -> False]],
            Annotation[#, 
             Style[
              Dynamic[
               FEPrivate`FrontEndResource["FEStrings", "sizeExplanation"]], 
              DynamicUpdating -> True, LineIndent -> 0, 
              LinebreakAdjustments -> {1., 100, 0, 0, 0}, 
              LineSpacing -> {1, 2}], "Tooltip"]& ],
           Alignment->Center,
           BaselinePosition->Baseline,
           ImageSize->{Automatic, {25, Full}}], 
          ButtonBox[
           PaneSelectorBox[{False->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], 
                StandardForm],
               ImageSizeCache->{54., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl",
             StripOnInput->False], True->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowLess"], 
                StandardForm],
               ImageSizeCache->{54., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive",
             StripOnInput->False]}, Dynamic[
             CurrentValue["MouseOver"]],
            Alignment->Center,
            FrameMargins->0,
            ImageSize->{Automatic, {25, Full}}],
           Appearance->None,
           BaselinePosition->Baseline,
           
           ButtonFunction:>OutputSizeLimit`ButtonFunction[
            OutputSizeLimit`Defer, 16, 29561006755129039129, 5/2],
           Enabled->True,
           Evaluator->Automatic,
           Method->"Queued"], 
          ButtonBox[
           PaneSelectorBox[{False->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], 
                StandardForm],
               ImageSizeCache->{61., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl",
             StripOnInput->False], True->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowMore"], 
                StandardForm]],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive",
             StripOnInput->False]}, Dynamic[
             CurrentValue["MouseOver"]],
            Alignment->Center,
            FrameMargins->0,
            ImageSize->{Automatic, {25, Full}}],
           Appearance->None,
           BaselinePosition->Baseline,
           
           ButtonFunction:>OutputSizeLimit`ButtonFunction[
            OutputSizeLimit`Defer, 16, 29561006755129039129, 5 2],
           Enabled->True,
           Evaluator->Automatic,
           Method->"Queued"], 
          ButtonBox[
           PaneSelectorBox[{False->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], 
                StandardForm],
               ImageSizeCache->{46., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl",
             StripOnInput->False], True->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeShowAll"], 
                StandardForm],
               ImageSizeCache->{46., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive",
             StripOnInput->False]}, Dynamic[
             CurrentValue["MouseOver"]],
            Alignment->Center,
            FrameMargins->0,
            ImageSize->{Automatic, {25, Full}}],
           Appearance->None,
           BaselinePosition->Baseline,
           
           ButtonFunction:>OutputSizeLimit`ButtonFunction[
            OutputSizeLimit`Defer, 16, 29561006755129039129, Infinity],
           Enabled->True,
           Evaluator->Automatic,
           Method->"Queued"], 
          ButtonBox[
           PaneSelectorBox[{False->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], 
                StandardForm],
               ImageSizeCache->{83., {0., 8.}}],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControl",
             StripOnInput->False], True->
            StyleBox[
             StyleBox[
              DynamicBox[ToBoxes[
                FEPrivate`FrontEndResource["FEStrings", "sizeChangeLimit"], 
                StandardForm]],
              StripOnInput->False,
              DynamicUpdating->True,
              LineSpacing->{1, 2},
              LineIndent->0,
              LinebreakAdjustments->{1., 100, 0, 0, 0}], "OSLControlActive",
             StripOnInput->False]}, Dynamic[
             CurrentValue["MouseOver"]],
            Alignment->Center,
            FrameMargins->0,
            ImageSize->{Automatic, {25, Full}}],
           Appearance->None,
           BaselinePosition->Baseline,
           ButtonFunction:>FrontEndExecute[{
              FrontEnd`SetOptions[
              FrontEnd`$FrontEnd, 
               FrontEnd`PreferencesSettings -> {"Page" -> "Advanced"}], 
              FrontEnd`FrontEndToken["PreferencesDialog"]}],
           Evaluator->None,
           Method->"Preemptive"]}
        },
        AutoDelete->False,
        FrameStyle->GrayLevel[0.85],
        GridBoxDividers->{"Columns" -> {False, {True}}},
        GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
        GridBoxSpacings->{"Columns" -> {{2}}}]}
     },
     DefaultBaseStyle->"Column",
     GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
     GridBoxDividers->{"Columns" -> {{False}}, "Rows" -> {{False}}},
     GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.5599999999999999]}, 
         Offset[0.27999999999999997`]}, "Rows" -> {
         Offset[0.2], 
         Offset[1.2], {
          Offset[0.4]}, 
         Offset[0.2]}}],
    BaseStyle->"OutputSizeLimit",
    FrameMargins->{{12, 12}, {0, 15}},
    FrameStyle->GrayLevel[0.85],
    RoundingRadius->5,
    StripOnInput->False],
   Deploy,
   DefaultBaseStyle->"Deploy"],
  If[29561006755129039129 === $SessionID, 
   Out[16], Message[
     MessageName[Syntax, "noinfoker"]]; Missing["NotAvailable"]; 
   Null]]], "Output",
 CellChangeTimes->{
  3.823595603762179*^9, {3.823595635713426*^9, 3.8235956777038507`*^9}, 
   3.823595712209647*^9, 3.823599409865849*^9, {3.823599459668364*^9, 
   3.823599464038105*^9}, {3.823602848043659*^9, 3.823602886956541*^9}},
 CellLabel->"Out[16]=",ExpressionUUID->"38574d08-ae8e-4fc2-be09-08955360fdff"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"tmp", "=", 
   RowBox[{"D", "[", 
    RowBox[{
     RowBox[{"eM", "[", 
      RowBox[{"[", "6", "]"}], "]"}], ",", "\[Theta]7"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ToString", "[", 
   RowBox[{"tmp", ",", "CForm"}], "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input",
 CellChangeTimes->{{3.823594395534802*^9, 3.823594412717284*^9}, {
   3.823594895697111*^9, 3.823594908600604*^9}, {3.823594963617971*^9, 
   3.823595138170384*^9}, {3.823595177571471*^9, 3.8235953003878927`*^9}, 
   3.8237517626082907`*^9},
 CellLabel->"In[23]:=",ExpressionUUID->"f934a522-8b1f-4ba2-941b-f8a1252d3712"],

Cell[BoxData[
 TemplateBox[{
  "Part","partd",
   "\"Part specification \\!\\(\\*RowBox[{\\\"eM\\\", \
\\\"\[LeftDoubleBracket]\\\", \\\"6\\\", \\\"\[RightDoubleBracket]\\\"}]\\) \
is longer than depth of object.\"",2,23,1,29561611951775162962,"Local"},
  "MessageTemplate"]], "Message", "MSG",
 CellChangeTimes->{3.8237517631418056`*^9},
 CellLabel->
  "During evaluation of \
In[23]:=",ExpressionUUID->"00ec474b-f02f-45f7-861f-2e1395d96af0"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"pelbow", "[", 
   RowBox[{"\[Theta]1_", ",", "\[Theta]2_", ",", "\[Theta]3_"}], "]"}], ":=", 
  
  RowBox[{
   RowBox[{"T", "[", 
    RowBox[{"0", ",", "0", ",", "\[Theta]1", ",", "0.333"}], "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     RowBox[{"-", 
      FractionBox["\[Pi]", "2"]}], ",", "0", ",", "\[Theta]2", ",", "0"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0", ",", "\[Theta]3", ",", "0.316"}], 
    "]"}], ".", 
   RowBox[{"T", "[", 
    RowBox[{
     FractionBox["\[Pi]", "2"], ",", "0.0825", ",", "0", ",", "0"}], 
    "]"}]}]}]], "Input",
 CellChangeTimes->{{3.823692303381714*^9, 3.823692313093701*^9}},
 CellLabel->"In[9]:=",ExpressionUUID->"945a2b31-754d-4fdb-8276-9e69341b497a"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"tmp", "=", 
   RowBox[{"pelbow", "[", 
    RowBox[{"\[Theta]1", ",", "\[Theta]2", ",", "\[Theta]3"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ToString", "[", 
   RowBox[{
    RowBox[{"Simplify", "[", "tmp", "]"}], ",", "CForm"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input",
 CellChangeTimes->{{3.82369231492756*^9, 3.823692322197592*^9}, {
  3.8236923671989527`*^9, 3.823692382966064*^9}, {3.823751749664494*^9, 
  3.823751764784334*^9}},
 CellLabel->"In[26]:=",ExpressionUUID->"b631774c-2d04-493b-8a99-35a0466935c8"]
}, Open  ]]
},
WindowSize->{1519, 1198},
WindowMargins->{{Automatic, 264}, {66, Automatic}},
FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 158, 3, 55, "Subsection",ExpressionUUID->"2638955b-d1e8-4e28-ba05-db1765a28fd7"],
Cell[741, 27, 1569, 42, 147, "Input",ExpressionUUID->"1293ae6c-31e5-4370-8907-caad95c252d0"],
Cell[2313, 71, 1558, 43, 83, "Input",ExpressionUUID->"d8b24c1a-4cdd-43ed-9ee4-98459c265c06"],
Cell[3874, 116, 625, 15, 31, "Input",ExpressionUUID->"5eced034-3e4c-4a28-956f-542ef9fac943"],
Cell[4502, 133, 2978, 74, 193, "Input",ExpressionUUID->"25bca131-2606-4f40-956f-9b4b520b9c99"],
Cell[7483, 209, 580, 14, 31, "Input",ExpressionUUID->"31153068-cde7-4919-97b6-1af27bb17782"],
Cell[CellGroupData[{
Cell[8088, 227, 801, 21, 31, "Input",ExpressionUUID->"9db25a01-77cb-4265-b9c7-eac93a89fd5b"],
Cell[8892, 250, 9008, 232, 95, "Output",ExpressionUUID->"38574d08-ae8e-4fc2-be09-08955360fdff"]
}, Open  ]],
Cell[CellGroupData[{
Cell[17937, 487, 695, 16, 78, "Input",ExpressionUUID->"f934a522-8b1f-4ba2-941b-f8a1252d3712"],
Cell[18635, 505, 443, 10, 23, "Message",ExpressionUUID->"00ec474b-f02f-45f7-861f-2e1395d96af0"]
}, Open  ]],
Cell[19093, 518, 788, 22, 46, "Input",ExpressionUUID->"945a2b31-754d-4fdb-8276-9e69341b497a"],
Cell[19884, 542, 630, 15, 78, "Input",ExpressionUUID->"b631774c-2d04-493b-8a99-35a0466935c8"]
}, Open  ]]
}
]
*)

